package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiCategoryMapper;
import com.lk.ii.domain.IiCategory;
import com.lk.ii.service.IIiCategoryService;
import com.lk.common.core.text.Convert;

/**
 * 种类Service业务层处理
 * 
 * @author lk
 * @date 2021-02-02
 */
@Service
public class IiCategoryServiceImpl implements IIiCategoryService 
{
    @Autowired
    private IiCategoryMapper iiCategoryMapper;

    @Override
    public List<IiCategory> getTypeCategoryList(String type) {
        return iiCategoryMapper.getTypeCategoryList(type);
    }

    /**
     * 查询种类
     * 
     * @param id 种类ID
     * @return 种类
     */
    @Override
    public IiCategory selectIiCategoryById(Long id)
    {
        return iiCategoryMapper.selectIiCategoryById(id);
    }

    /**
     * 查询种类列表
     * 
     * @param iiCategory 种类
     * @return 种类
     */
    @Override
    public List<IiCategory> selectIiCategoryList(IiCategory iiCategory)
    {
        return iiCategoryMapper.selectIiCategoryList(iiCategory);
    }

    /**
     * 新增种类
     * 
     * @param iiCategory 种类
     * @return 结果
     */
    @Override
    public int insertIiCategory(IiCategory iiCategory)
    {
        iiCategory.setCreateTime(DateUtils.getNowDate());
        return iiCategoryMapper.insertIiCategory(iiCategory);
    }

    /**
     * 修改种类
     * 
     * @param iiCategory 种类
     * @return 结果
     */
    @Override
    public int updateIiCategory(IiCategory iiCategory)
    {
        iiCategory.setUpdateTime(DateUtils.getNowDate());
        return iiCategoryMapper.updateIiCategory(iiCategory);
    }

    /**
     * 删除种类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiCategoryByIds(String ids)
    {
        return iiCategoryMapper.deleteIiCategoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除种类信息
     * 
     * @param id 种类ID
     * @return 结果
     */
    @Override
    public int deleteIiCategoryById(Long id)
    {
        return iiCategoryMapper.deleteIiCategoryById(id);
    }

    /**
     * 实现模糊查询
     * @param iiCategory
     * @return
     */
    @Override
    public List<IiCategory> select(IiCategory iiCategory) {
        return iiCategoryMapper.select(iiCategory);
    }
}
